package com.huiquan.vocab.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.huiquan.framework.base.EnhancedBaseDao;
import com.huiquan.vocab.domain.VocabElementOOaEquals;
import com.ibatis.sqlmap.client.SqlMapClient;

@Repository
public class VocabElementOOaEqualsDao extends EnhancedBaseDao<VocabElementOOaEquals> {

	@Resource(name = "sqlMapClient")
	private SqlMapClient sqlMapClient;

	public static final String space = "VOCAB_ELEMENT_O_OA_EQUALS.";

	public VocabElementOOaEqualsDao() {
		super(space);
	}

	public void init() {
		this.update(space + "INIT", sqlMapClient);
	}

	@SuppressWarnings("unchecked")
	public List<String> retrieveWrongElement() {
		return (List<String>) this.list(space + "RETRIEVE_WRONG_ELEMENT", sqlMapClient);
	}

	@SuppressWarnings("unchecked")
	public List<String> retrieveWrongSynonyms() {
		return (List<String>) this.list(space + "RETRIEVE_WRONG_SYNONYMS", sqlMapClient);
	}

	public void setFlagByDisplay(String displayIds) {

		Map<String, Object> param = new HashMap<>();
		param.put("displayIds", displayIds);
		
		this.update(space + "SET_FLAG_BY_DISPLAY", param, sqlMapClient);
	
	}

}
